package com.anycl.design.j2ee.interceptingfilter;

/**
 * 过滤管理器
 */
public class FilterManager {
    // 过滤器链
    private FilterChain filterChain = new FilterChain();

    public FilterManager(Target target) {
        this.filterChain.setTarget(target);
    }

    public void addFilter(Filter filter) {
        this.filterChain.addFilter(filter);
    }

    /**
     * 客户端的请求委托到这里进行过滤
     */
    public void filterRequest(String request) {
        this.filterChain.doFilter(request);
    }
}
